//角色战斗属性
class FightAttri {
    static getInstance() {
        if (!FightAttri.instance) {
            FightAttri.instance = new FightAttri();
        }
        return FightAttri.instance;
    }

    create(opts) {
        opts = opts || {};
        return {
            hp: opts.hp || 0, //生命
            name: opts.name || '',
            templateId: opts.templateId || 0,
            maxHp: opts.maxHp || 0, //最大生命
            attack: opts.attack || 0, //攻击力
            pdef: opts.pdef || 0, //物理防御力
            ldef: opts.ldef || 0, //法术防御力
            crit: opts.crit || 0, //暴击
            critHurt: opts.critHurt || 0, //暴击伤害
            toughness: opts.toughness || 0, //韧性
            guard: opts.guard || 0, //守护
            speed: opts.speed || 1, //速度
            skills: opts.skills || [],
            recover: opts.recover || 0, //回血
            con: opts.con || 0,
            str: opts.str || 0,
            will: opts.will || 0,
            sta: opts.sta || 0,
            agile: opts.agile || 0,
            lvl: opts.lvl || 1, //等级
            hatred: opts.hatred || 0,
        }
    }
}

export default FightAttri.getInstance();